package com.feiwo.nonego.rpc.protocol.header;

import com.feiwo.nonego.rpc.common.constants.CommonConstants;
import com.feiwo.nonego.rpc.protocol.base.MessageIdGeneratorFactory;
import com.feiwo.nonego.rpc.protocol.enums.RpcType;

/**
 * @author feiwo 2025-08-05
 */
public class RpcHeaderFactory {

    public static RpcHeader getRequestHeader(String serializationType) {
        var header = new RpcHeader();
        header.setMagic(CommonConstants.MAGIC_NUMBER);
        header.setMsgId(MessageIdGeneratorFactory.generate());
        header.setMsgType((byte) RpcType.REQUEST.getType());
        header.setStatus((byte) 0x1);
        header.setSerializationType(serializationType);
        return header;
    }

}
